home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / New System Software Extensions / PlainTalk™ Speech Technologies / Text To Speech / Programming Stuff / Examples / WannaSpeech / Start.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-15  |  3.1 KB  |  113 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:        Start.c
  5. ** Written by:    Eric Soldan
  6. **
  7. ** Copyright © 1989-1993 Apple Computer, Inc.
  8. ** All rights reserved.
  9. */
  10.  
  11. /* You may incorporate this sample code into your applications without
  12. ** restriction, though the sample code has been provided "AS IS" and the
  13. ** responsibility for its operation is 100% yours.  However, what you are
  14. ** not permitted to do is to redistribute the source as "DSC Sample Code"
  15. ** after having made changes. If you're going to re-distribute the source,
  16. ** we require that you make it clear in the source that the code was
  17. ** descended from Apple Sample Code, but that you've made changes. */
  18.  
  19.  
  20. /**************************************************************************************
  21. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 
  22.  
  23. Changes have been made to the pristine purity of this code I have added the lines
  24. necessary to change it from AppWannaBe to WannaSpeech, the Text to Speech sample
  25. from AppleSoft Developer Technical Support
  26.  
  27.    Written by:    Guillermo A. Ortiz        AppleSoft Developer Technical Support
  28.    Date:        08/04/93
  29.  
  30. Please read WannaSpeech.readme for the gruesome details.
  31. **************************************************************************************/
  32.  
  33.  
  34. /*****************************************************************************/
  35.  
  36.  
  37.  
  38. #include "App.h"            /* Get the application includes/typedefs, etc.    */
  39. #include "App.protos.h"        /* Get the prototypes for application.            */
  40.  
  41. #include "WannaSpeech.h"
  42.  
  43. #ifndef __TEXTSERVICES__
  44. #include <TextServices.h>
  45. #endif
  46.  
  47. #ifndef __TOOLUTILS__
  48. #include <ToolUtils.h>
  49. #endif
  50.  
  51. #ifndef __HEADERS__            /* This include allows THINK to search all header files. */
  52. #include <Headers.h>
  53. #endif
  54.  
  55.  
  56.  
  57. /*****************************************************************************/
  58.  
  59.  
  60.  
  61. #ifndef THINK_C
  62. extern void _DataInit();
  63. #endif
  64.  
  65.  
  66.  
  67. /*****************************************************************************/
  68. /*****************************************************************************/
  69.  
  70. extern Boolean gCanTalk;
  71.  
  72. #pragma segment Main
  73. void    main(void)
  74. {
  75.  
  76. #ifndef THINK_C
  77.     UnloadSeg((Ptr)_DataInit);        /* Note that _DataInit can't be in Main! */
  78. #endif
  79.  
  80.     SetApplLimit(GetApplLimit() - 16384);
  81.         /* This decreases the application heap by 16k, which in turn
  82.         ** increases the stack by 16k. */
  83.  
  84.     MaxApplZone();                    /* Expand the heap so code segments load at the top. */
  85.  
  86.     Initialize(32, kMinHeap, kMinSpace, nil, nil);    /* Initialize the program. */
  87.     DoSetResCursor(watchCursor);                    /* Rest of startup may take a while. */
  88.     InitRequiredAppleEvents();
  89.     InitWFMTAppleEvents();
  90.     GetWindowFormats();                        /* Get the window definition resource information. */
  91.     OpenRuntimeOnlyAutoNewWindows();
  92.     DoOpenApplication();
  93.     
  94.     gCanTalk = SpeechAvailable();
  95.     
  96.     DoAdjustMenus();
  97.     StartDocuments();                        /* Open (or print) designated documents for 6.0. */
  98.  
  99.     if(CTEUseTSMTE())
  100.         InitTSMAwareApplication();
  101.  
  102.     UnloadSeg((Ptr)Initialize);        /* Initialize can't be in Main! */
  103.     EventLoop();                    /* Call the main event loop. */
  104.  
  105.     if(CTEUseTSMTE())
  106.         CloseTSMAwareApplication();
  107.  
  108.     ExitToShell();                    /* Quit the application. */
  109. }
  110.  
  111.  
  112.  
  113.